home *** CD-ROM | disk | FTP | other *** search
/ PC World Interactive 11 / PC World Interactive 11.iso / share / multimed / effect / Common Files / QTVRUtilities.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-13  |  6.0 KB  |  141 lines

  1. //////////
  2. //
  3. //    File:        QTVRUtilities.h
  4. //
  5. //    Contains:    Some utilities for working with QuickTime and QuickTime VR movies.
  6. //                All utilities start with the prefix "QTVRUtils_".
  7. //
  8. //    Written by:    Tim Monroe
  9. //
  10. //    Copyright:    ⌐ 1996-1997 by Apple Computer, Inc., all rights reserved.
  11. //
  12. //    Change History (most recent first):
  13. //
  14. //       <2>         01/27/97    rtm        added some constants
  15. //       <1>         11/27/96    rtm        first file
  16. //       
  17. //////////
  18.  
  19. #pragma once
  20.  
  21. // header files
  22.  
  23. #ifndef __QTVRUtilities__
  24. #define __QTVRUtilities__
  25.  
  26. #ifndef __MOVIES__
  27. #include <Movies.h>
  28. #endif
  29.  
  30. #ifndef __QUICKTIMEVR__
  31. #include <QuickTimeVR.h>
  32. #endif
  33.  
  34. #ifndef __QUICKTIMEVRFORMAT__
  35. #include <QuickTimeVRFormat.h>
  36. #endif
  37.  
  38. #ifndef __TRAPS__
  39. #include <Traps.h>
  40. #endif
  41.  
  42. #ifndef __GESTALT__
  43. #include <Gestalt.h>
  44. #endif
  45.  
  46. #ifndef __Prefix_File__
  47. #include "WinPrefix.h"
  48. #endif
  49.  
  50. #include <Endian.h>
  51. #include "QD3D.h"
  52.  
  53. // constants
  54.  
  55. enum {
  56.     kQTVRSpeakerButton         = mcFlagSuppressSpeakerButton,
  57.     kQTVRBackButton         = mcFlagQTVRSuppressBackBtn,
  58.     kQTVRZoomButtons         = mcFlagQTVRSuppressZoomBtns,
  59.     kQTVRHotSpotButton         = mcFlagQTVRSuppressHotSpotBtn,
  60.     kQTVRTranslateButton     = mcFlagQTVRSuppressTranslateBtn,
  61.     kQTVRHelpText             = mcFlagQTVRSuppressHelpText,
  62.     kQTVRHotSpotNames         = mcFlagQTVRSuppressHotSpotNames,
  63.     kQTVRCustomButton         = mcFlagsUseCustomButton
  64. };
  65.  
  66. // values of ╣
  67. #define kVRPi                     ((float)3.1415926535898)
  68. #define kVR2Pi                     ((float)(2.0 * 3.1415926535898))
  69. #define kVRPiOver2                ((float)(3.1415926535898 / 2.0))
  70. #define kVR3PiOver2                ((float)(3.0 * 3.1415926535898 / 2.0))
  71.  
  72. // define a constant for an invalid hot spot ID;
  73. // hot spot IDs are just indices into an 8-bit palette, so valid IDs range from 0 to 255
  74. #define kQTVRUtils_InvalidHotSpotID                (UInt32)-1
  75.  
  76.  
  77. //////////
  78. //
  79. // QTVRUtils_DegreesToRadians
  80. // QTVRUtils_RadiansToDegrees
  81. // Angle conversion utilities.
  82. //
  83. //////////
  84.  
  85. #define QTVRUtils_DegreesToRadians(x)            ((float)((x) * kVRPi / 180.0))
  86. #define QTVRUtils_RadiansToDegrees(x)            ((float)((x) * 180.0 / kVRPi))
  87.  
  88. // some other define'd symbols
  89. #define QTVRUtils_GetDistance(thePoint)            sqrt((thePoint.x*thePoint.x)+(thePoint.y*thePoint.y)+(thePoint.z*thePoint.z))
  90.  
  91. // function prototypes
  92.  
  93. Boolean                        QTVRUtils_TrapAvailable (short theTrapWord);
  94. Boolean                        QTVRUtils_IsQTVRMgrInstalled (void);
  95. long                        QTVRUtils_GetQTVRVersion (void);
  96. OSType                        QTVRUtils_GetControllerType (Movie theMovie);
  97. OSErr                        QTVRUtils_SetControllerType (Movie theMovie, OSType theType);
  98. Boolean                        QTVRUtils_IsQTVRMovie (Movie theMovie);
  99. Boolean                        QTVRUtils_Is20QTVRMovie (Movie theMovie);
  100. Boolean                        QTVRUtils_IsTranslateAvailable (QTVRInstance theInstance);
  101. Boolean                        QTVRUtils_IsZoomAvailable (QTVRInstance theInstance);
  102. Boolean                        QTVRUtils_IsPanoNode (QTVRInstance theInstance);
  103. Boolean                        QTVRUtils_IsObjectNode (QTVRInstance theInstance);
  104. Boolean                        QTVRUtils_IsHotSpotInNode (QTVRInstance theInstance);
  105. Boolean                        QTVRUtils_IsMultiNode (QTVRInstance theInstance);
  106. Boolean                        QTVRUtils_IsControllerBarVisible (MovieController theMC); 
  107. short                        QTVRUtils_GetControllerBarHeight (MovieController theMC);
  108. void                        QTVRUtils_HideControllerBar (MovieController theMC);
  109. void                        QTVRUtils_ShowControllerBar (MovieController theMC);
  110. void                        QTVRUtils_ToggleControllerBar (MovieController theMC);
  111. void                        QTVRUtils_HideControllerButton (MovieController theMC, long theButton); 
  112. void                        QTVRUtils_ShowControllerButton (MovieController theMC, long theButton); 
  113. void                        QTVRUtils_ToggleControllerButton (MovieController theMC, long theButton);
  114. void                        QTVRUtils_ResetControllerButton (MovieController theMC, long theButton);
  115. Boolean                        QTVRUtils_IsControllerButtonVisible (MovieController theMC, long theButton);
  116. void                        QTVRUtils_HideHotSpotNames (MovieController theMC);
  117. void                        QTVRUtils_ShowHotSpotNames (MovieController theMC);
  118. void                        QTVRUtils_ToggleHotSpotNames (MovieController theMC);
  119. OSErr                        QTVRUtils_GetVRWorldHeaderAtomData (QTVRInstance theInstance, QTVRWorldHeaderAtomPtr theVRWorldHdrAtomPtr);
  120. OSErr                        QTVRUtils_GetNodeHeaderAtomData (QTVRInstance theInstance, UInt32 theNodeID, QTVRNodeHeaderAtomPtr theNodeHdrPtr);
  121. OSErr                        QTVRUtils_GetHotSpotAtomData (QTVRInstance theInstance, UInt32 theNodeID, UInt32 theHotSpotID, QTVRHotSpotInfoAtomPtr theHotSpotInfoPtr);
  122. char *                        QTVRUtils_GetStringFromAtom (QTAtomContainer theContainer, QTAtom theParent, QTAtomID theID);
  123. OSErr                        QTVRUtils_AddStr255ToAtomContainer (QTAtomContainer theContainer, QTAtom theParent, Str255 theString, QTAtomID *theID);
  124. UInt32                        QTVRUtils_GetDefaultNodeID (QTVRInstance theInstance);
  125. UInt32                        QTVRUtils_GetSceneFlags (QTVRInstance theInstance);
  126. char *                        QTVRUtils_GetSceneName (QTVRInstance theInstance);
  127. UInt32                        QTVRUtils_GetNodeCount (QTVRInstance theInstance);
  128. OSErr                        QTVRUtils_GetNodeType (QTVRInstance theInstance, UInt32 theNodeID, OSType *theNodeType);
  129. char *                        QTVRUtils_GetNodeName (QTVRInstance theInstance, UInt32 theNodeID);
  130. char *                        QTVRUtils_GetNodeComment (QTVRInstance theInstance, UInt32 theNodeID);
  131. UInt32                        QTVRUtils_GetHotSpotCount (QTVRInstance theInstance, UInt32 theNodeID, Handle theHotSpotIDs);
  132. UInt32                        QTVRUtils_GetHotSpotIDByIndex (QTVRInstance theInstance, Handle theHotSpotIDs, UInt32 theIndex);
  133. OSErr                        QTVRUtils_GetHotSpotType (QTVRInstance theInstance, UInt32 theNodeID, UInt32 theHotSpotID, OSType *theHotSpotType);
  134. char *                        QTVRUtils_GetHotSpotName (QTVRInstance theInstance, UInt32 theNodeID, UInt32 theHotSpotID);
  135. float                        QTVRUtils_Point3DToPanAngle (float theX, float theY, float theZ);
  136. float                        QTVRUtils_Point3DToTiltAngle (float theX, float theY, float theZ);
  137. PASCAL_RTN OSErr            QTVRUtils_StandardEnteringNodeProc (QTVRInstance theInstance, long theNodeID, MovieController theMC);
  138. PASCAL_RTN OSErr            QTVRUtils_StandardLeavingNodeProc (QTVRInstance theInstance, long fromNodeID, long toNodeID, Boolean *theCancel, MovieController theMC);
  139.  
  140.  
  141. #endif    // ifndef __QTVRUtilities__